let oUserPhone = document.querySelector("#userPhone");
let oUserPwd = document.querySelector("#uesrPwd");
 let oDengLu = document.querySelector("#denglu");
 oDengLu.onclick = function(){
	 let xhr = new XMLHttpRequest();
	 xhr.open("post","../jumei/login.php",true);
	 xhr.setRequestHeader("Content-Type","application/x-www-form-urlencoded");
	 xhr.onreadystatechange = function(){
	 	if(xhr.status==200 && xhr.readyState==4){
	 		fun(xhr.responseText);
	 	}
	 }
	 xhr.send("userPhone="+oUserPhone.value+"&userPwd="+oUserPwd.value);
 }
 function fun(resText){
	 if(resText ==0){
	 $(window).attr('location', '../jumei/index.html');
	 console.log("你好");
	 }else if(resText ==1){
		 console.log("电话输入错误");
	 }else if(resText==2){
		console.log("密码输入错误");
	 }
 }
 